package com.xls.future.utils;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.request.RequestOptions;
import com.xls.future.R;
import com.xls.future.listener.LoadImageListener;
import com.youth.banner.loader.ImageLoader;

/**
 * Created by Administrator on 2017/8/25.
 */

public class GlideImageLoader extends ImageLoader {

    RequestOptions options = new RequestOptions()
            .centerCrop()
            .placeholder(R.mipmap.banner_place_holder)
            .error(R.mipmap.banner_place_holder)
            .priority(Priority.HIGH);

    private LoadImageListener<Drawable> loadImageListener = new LoadImageListener<>();


    @Override
    public void displayImage(Context context, Object path, ImageView imageView) {
        Glide.with(context).load(path).apply(options).listener(loadImageListener).into(imageView);
    }
}
